package com.hyt.it.ogt.ks.controller;

import com.hyt.common.apiInfor.ApiResponse;
import com.hyt.common.apiInfor.DataType;
import com.hyt.common.apiInfor.ParamType;
import com.hyt.it.ogt.ks.enums.BizStatusCode;
import com.hyt.it.ogt.ks.feign.KwClient;
import com.hyt.it.ogt.ks.model.vo.PcClientDownAddressVO;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@Api(tags = "35.App监控接口", value = "App监控接口")
@ApiSort(35)
@Slf4j
@RestController
@RequestMapping("/ks/app/Monitor/")
public class AppMonitorController {
    @Resource
    private KwClient kwClient;

    @ApiOperation(value = "35.1 获取app人脸核身信息", notes = "20000:成功, 返回参数：orderId-订单号,appId-APP_ID ,apiVersion-openapi版本号,nonce-32位随机字符串,userId-用户id,license-在人脸核身控制台内申请", response = String.class)
    @ApiOperationSort(1)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "examId", value = "考试ID", dataType = DataType.STRING,
                    paramType = ParamType.QUERY, required = true),
            @ApiImplicitParam(name = "examCandidateId", value = "考生ID", dataType = DataType.STRING,
                    paramType = ParamType.QUERY, required = true)
    })
    @GetMapping("getFaceInfo")
    public Object getFaceInfo(@RequestParam String examId, @RequestParam String examCandidateId) {
        String json = kwClient.getFaceUrl(examId, examCandidateId, "1", "app");
        return ApiResponse.ConvertRet(json, Map.class);
    }
}
